/**
 * Created with IntelliJ IDEA.
 * User: Администратор
 * Date: 01.07.12
 * Time: 3:28
 * To change this template use File | Settings | File Templates.
 */

require(
    [ "dojo/parser", "dijit/form/Button", "dijit/form/TextBox", "esri/map" ]
    );
dojo.require("esri.map");
//dojo.require("dojo.parser");
//dojo.require("dijit.form.Button");
//dojo.require("dijit.form.TextBox");

var init = function() {
//    require(
//        ["dojo/on"], function(on) {
//            on(
//                map,
//                "click",
//                map_onClick
//            );
//        }
//    );
    console.log(map);
//    dojo.connect(map, "onClick", map_onClick);
}
var geographic;
//button onClick listener
var map_onClick = function(event) {
    console.log("Map onClick event", event);
    // Seat Geek expects latitude, longitude
    geographic = esri.geometry.webMercatorToGeographic(event.mapPoint);
    dojo.byId("txtLatitude").value = geographic.y;
    dojo.byId("txtLongitude").value = geographic.x;
}

//start initializing
//dojo.addOnLoad(init);  //<1.7
//require(["dojo/ready"], function(ready){
//  ready(init);
//});